package 力扣刷题.探索初级算法.数组.存在重复;

import java.util.Arrays;
import java.util.Scanner;

public class Solution {
    public boolean containsDuplicate(int[] nums) {
        Arrays.sort(nums);

        if(nums.length==0||nums.length==1)
            return false;
        else {
            for (int i = 1; i < nums.length;i++) {
                if(nums[i]==nums[i-1]) {
                    return true;
                }
            }
        }
        return false;
    }
    public static void main(String[] args) {

        int len;
        Scanner s=new Scanner(System.in);
        len=s.nextInt();
        int[] nums=new int[len];
        for (int i = 0; i < len; i++) {
            nums[i]=s.nextInt();
        }
        System.out.println(new Solution().containsDuplicate(nums));
    }
}
